using System;
using System.Collections.Generic;
using System.Text;

namespace GSN.Mail.Messages
{
    static class MsgFieldParser
    {
        public static string parseField(string str, string field)
        {
            string value = null;

            int index = -1;
            index = str.IndexOf(field);
            if (index >= 0)
            {
                index += field.Length;
                value = str.Substring(index + 1, str.IndexOf("\r\n", index)-index-1);
            }

            return value;
        }
    }
}
